package com.xhdx.pattern.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * 具体容器
 */
public class ConcreteContainer implements Container{
    private List<String> list = new ArrayList<String>();

    @Override
    public void add(String str) {
        list.add(str);
        
    }

    @Override
    public void remove(String str) {
        list.remove(str);
        
    }
    @Override
    public Iterator<String> iterator(){
        return new ConcreteIterator(list);
    }
}
